import java.util.Scanner;

/**
 * Created by L.jp
 * Description:给一个正整数，长度为偶数，然后分割成两半，求和，要求和最小...
 * User: 86189
 * Date: 2023-04-20
 * Time: 23:25
 */
public class Solution {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        String str=String.valueOf(n);
        int len=str.length();
        int mid=len/2;
        Integer left=Integer.parseInt(str.substring(0,mid));
        Integer right=Integer.parseInt(str.substring(mid));
        int res=left+right;
        System.out.println(res);
    }
}
